#!/bin/bash 
# 根据$1的名单在$2中找到对应的kabi并输出
# $1为Module.kabi_*，$2为新kabi

kabi_white=`awk '{print$2}' $1`
ff=1.txt

rm $ff

while read line
do
    kabi=`echo $line | awk '{print$2}'`
    for i in ${kabi_white[@]}
    do
        if [ "$i" == "$kabi" ]; then
            ll=`cat $1| grep -w $kabi`
            crc=`echo $line | awk '{print$1}'`
            awk '{$1="'$crc'";printf "%s\t%s\t%s\t%s\n",$1,$2,$3,$4}' <<< $ll >> $ff
        fi
    done
done < $2

LC_ALL=C sort -k 2 $ff > $ff.tmp
mv $ff.tmp $ff